package com.mrd.gtimp.business.service;

import com.mrd.base.BaseBiz;
import com.mrd.gtimp.business.entity.BaseAttachment;
import com.mrd.spring.repository.BaseRepository;

import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

import javax.annotation.Resource;

/**
 * <p>
 * application name: sample
 * <p>
 * copyright: Copyright@2012 明睿达科技有限公司
 */

/**
 * 定义附件行为类
 * @author winaya
 */

@Service
public class BaseAttachmentBiz<T extends BaseAttachment> extends BaseBiz<BaseAttachment> {

	/**
	 * 根据ID进行查询
	 * @param ids
	 *            Array|String
	 */
	public List<BaseAttachment> findByIds(String... ids) {
		return baseRepository.findAll(Arrays.asList(ids));
	}

	/**
	 * 批量删除
	 */
	public void deleteInBatch(List<BaseAttachment> baseAttachments) {
		baseRepository.deleteInBatch(baseAttachments);
	}

	@Override
	@Resource
	public void setBaseRepository(BaseRepository<BaseAttachment, String> baseRepository) {
		this.baseRepository = baseRepository;
	}
}
